{{partial('public/header')}}
<!--main-->
<div class="midder">

<div class="mc">

{% if strUser['userid'] == visitor['userid']%}
<h1>{{seo.title}}({{strUser['count_followed']}})</h1>
{% else %}
{{partial('index/user_header')}}  
<div class="clear"></div>
{% endif %}
   
	<div class="cleft">
{% if strUser['userid'] == visitor['userid']%}
<ul class="user-list">
{% for item in arrFollowedUser %}
    <li class="clearfix" id="u{{item['userid']}}">
        <a title="{{item['username']}}" href="{{url('space/'~item['doname'])}}">
        <img alt="{{item['username']}}" src="{{item['face_48']}}" class="face">
        </a>
        <div class="info">
          <h3>
              <a title="{{item['username']}}" href="{{url('space/'~item['doname'])}}">{{item['username']}}</a>
              
              {% if item['isfollow']%}
              	<span class="user-cs">已关注</span>
              {% else %}
              <a class="a-btn-add mr10 add_contact" data-id="{{item['userid']}}" href="javascript:void(0);">关注此人</a>		
              {% endif %}
          </h3>
          <!-- 签名档 -->
          <p>{{item['area']['areaname']}}<br>
             被<b>{{item['count_followed']}}</b>人关注&nbsp;&nbsp;关注<b>{{item['count_follow']}}</b>人          
          </p>
        </div>
        <!--<span class="ban">加入黑名单</span>-->
    </li>
{% endfor %}         
</ul>
{% else %}

{% for item in arrFollowedUser %}
<dl class="obu">
<dt>
<a class="nbg" title="{{item['username']}}" href="{{url('space/'~item['doname'])}}">
<img alt="{{item['username']}}" class="m_sub_img" src="{{item['face_48']}}">
</a>
</dt>
<dd><a title="{{item['username']}}" href="{{url('space/'~item['doname'])}}">{{item['username']}}</a></dd>
</dl>
{% endfor %}  

{% endif %}

		<div class="page">{{pageUrl}}</div>
    </div>

    <div class="cright">

{% if strUser['userid'] == visitor['userid']%}
        <p class="pl2">
            &gt;&nbsp;<a href="{{url('space/contact/follow/'~strUser['userid'])}}">我关注的人(<span id="cout_follow">{{strUser['count_follow']}}</span>)</a>
        </p> 
{% else %}
        <p class="pl2">
            &gt;&nbsp;<a href="{{url('space/contact/follow/'~strUser['userid'])}}">{{strUser['username']}}关注的人({{strUser['count_follow']}})</a>
        </p> 
{% endif %}              
<!---
        <p class="pl2">
            &gt;&nbsp;<a href="/contacts/find">寻找&nbsp;MSN/Gtalk&nbsp;朋友</a>
        </p>
-->        
        <p class="pl2">
            &gt;&nbsp;<a href="{{url('space/contact/invite')}}">邀请我的朋友加入爱客网</a>
        </p>


    </div>

</div>
</div>
<script language="javascript">
$(function(){
	$('.add_contact').bind('click',function(){
		var posturl = '{{url("space/contact/userfollowAjax")}}';
		var self = this, parent = $(self).parents('h3');
		var peopleId = $(this).attr('data-id');
		$.post_withck(
			posturl,
			{ 'userid_follow': peopleId },
			function (result) {
				var obj = $.parseJSON(result);
				if(obj.res==1){
					$('#cout_follow').text(obj.cout_follow);
					parent.append('<span class="user-cs">已关注</span>');
					$(self).remove();					
				}else{
					alert(obj.msg)	
				}					
			}
		);
	});	
})
</script>